import type { ProColumns } from '@ant-design/pro-table';
import { IPFSListItem, columnsDataType } from './data.d';

export const columnsData: ProColumns<columnsDataType>[] = [
  // table里面的内容
  {
    title: '序号',
    dataIndex: 'order',
    valueType: 'indexBorder',
    hideInSearch: true,
    width: 50,
    fixed: 'left',
  },
  {
    title: '身份名称',
    dataIndex: 'name',
    hideInSearch: true,
    width: 160,
    fixed: 'left',
  },
  {
    title: '身份编号',
    dataIndex: 'code',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '身份等级',
    dataIndex: 'grade',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '身份总量',
    dataIndex: 'totalSupply',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '身份封面',
    dataIndex: 'gradeCover',
    hideInSearch: true,
    valueType: 'image',
    width: 160,
  },
  {
    title: '铸造状态',
    dataIndex: 'status',
    hideInSearch: true,
    valueType: 'select',
    valueEnum: {
      0: {
        text: '未铸造',
      },
      1: {
        text: '已铸造',
      },
    },
    width: 200,
  },
  {
    title: '操作',
    dataIndex: 'action',
    hideInSearch: true,
    width: 200,
    fixed: 'right',
  },
];

export const IPFSColumns: ProColumns<IPFSListItem>[] = [
  {
    title: '序号',
    dataIndex: 'order',
    valueType: 'indexBorder',
    hideInSearch: true,
    width: 50,
    fixed: 'left',
  },
  {
    title: '等级',
    width: 60,
    dataIndex: 'grade',
    hideInSearch: true,
    fixed: 'left',
  },
  {
    title: '身份名称',
    width: 140,
    dataIndex: 'metadataName',
    hideInSearch: true,
  },
  {
    title: '元数据图片',
    dataIndex: 'metadataImage',
    hideInSearch: true,
    width: 100,
    valueType: 'image',
  },
  {
    title: '元数据',
    dataIndex: 'metadataUrl',
    hideInSearch: true,
  },
];
